// 手机号正则
// import type { AnyObject } from '@/types/common'

export const mapCenter = [108.862366, 34.287088]

export const PhonePattern = /^1[3-9]\d{9}$/

// 邮箱正则
export const EmailPattern = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/

// 坐标正则
export const CoordinatePattern = /^\d+(\.\d+)?$/

// ip正则
export const IPPattern =
  /(?:(?:1[0-9][0-9]\.)|(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:1[0-9][0-9])|(?:2[0-4][0-9])|(?:25[0-5])|(?:[1-9][0-9])|(?:[0-9]))/

// 性别枚举
export const GENDER_ENUM = [
  { label: '男', value: '1' },
  { label: '女', value: '2' },
  { label: '其他', value: '3' }
]
// export const GENDER: AnyObject = {
//   1: '男',
//   2: '女',
//   3: '其他'
// }

export const ENABLE_MARK_ENUM = [
  { label: '启用', value: 1 },
  { label: '禁用', value: 0 }
]
export const ENABLE_MARK = {
  1: '启用',
  0: '禁用'
}

// 网关服务配置
export const SERVER_CONFIG = {
  BASE: 'base'
}

// 需要和字典保持一致
// export enum FACTOR {
//   ext532p = 'ext532p',
//   ext1064 = 'ext1064',
//   dep = 'dep',
//   pm25 = 'pm25',
//   pm10 = 'pm10',
//   snr532p = 'snr532p',
//   radius = 'radius'
// }

import HeatTraffic from '@/assets/icon/heat_traffic@2x.png'
import HeatDust from '@/assets/icon/heat_dust@2x.png'
import HeatIndustry from '@/assets/icon/heat_industry_emission.png'
import HeatBurn from '@/assets/icon/heat_burn@2x.png'
import HeatOther from '@/assets/icon/heat_other@2x.png'

export const HEAT_ICON = {
  HeatDust: '0',
  HeatIndustry: '1',
  HeatTraffic: '2',
  HeatBurn: '3',
  HeatOther: '4'
}

export const HEAT_ICONS = {
  [HEAT_ICON.HeatDust]: HeatDust,
  [HEAT_ICON.HeatIndustry]: HeatIndustry,
  [HEAT_ICON.HeatTraffic]: HeatTraffic,
  [HEAT_ICON.HeatBurn]: HeatBurn,
  [HEAT_ICON.HeatOther]: HeatOther
}

// export type MAP_MODE = 'vector' | 'satellite'

// 维护一份各系数默认的范围
export const FactorRangeDefault= {
  ext532p: [0, 1],
  ext1064: [0, 1],
  dep: [0, 0.4],
  pm25: [0, 35],
  pm10: [0, 1],
  snr532p: [0, 10]
}

export const PageCache =
  'Home,AerosolSingleStation,AerosolGroupStation,OzoneSingleStation,OzoneGroupStation,WindSingleStation,GroupStation,HorizontalLidar,HorizontalLidarNetwork'

export const ProxyAddr = {
  development: 'http://220.180.238.27:8000',
  production: 'http://192.168.110.221:8180'
}
